package com.tyqx.hashchainbiz.service;

import com.mongodb.client.gridfs.GridFSBucket;
import com.tyqx.hashchainbean.module.HashIndex;
import com.tyqx.hashchainbean.module.NoHashValueJson;
import org.apache.ibatis.annotations.Param;
import org.bson.types.ObjectId;

import java.util.List;

public interface NoHashValueJsonService {

    public Integer insert(NoHashValueJson noHashValueJson);

    public List<NoHashValueJson> select();

    public int deleteByHashValue(String hashValue);

    public int deleteByRootHashValue(String rootHashValue);

    public int updateCountByTableNameAndTableId(String hashTableName, Integer hashTableId,String hashValue);


    public int updateStatus(Integer status,HashIndex hashIndex);

    public NoHashValueJson selectHashIndexByHashValue(String hashValue);

    public List<String> selectUserName(Integer status);

    public List<NoHashValueJson> selectByStatus(Integer status);

    public Integer selectCount(String userName);

    public List<NoHashValueJson> selectBatchGroupByUserName(String userName,Integer pageSize);

    public Integer updateBatchStatus(Integer status, HashIndex hashIndex,List<Long> idList);

    public NoHashValueJson selectHashIndexById(Long id);

     public void insertNoHashValueJsonAndMongoDB(ObjectId objectId,NoHashValueJson noHashValueJson,GridFSBucket gridFSFilesBucket)throws Exception;

    public Integer insertNoHashValueJsonBatch(List<NoHashValueJson> noHashValueJsonList)throws Exception;

    public void insertMongoDBBatch(List<ObjectId> objectIds,GridFSBucket gridFSFilesBucket,String fileName)throws Exception;


    public List<NoHashValueJson> selectByStatusBatch(Integer status,Integer batchSize);

    public Integer deleteBatch(List<String> hashValueList);

}
